using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.ObjectBuilder;
using Microsoft.Practices.CompositeWeb;
using System.Transactions;
using GC2.Entities.Admin;
using GC2.ExceptionHandler.Services;
using GC2.DataAccess.DAAdmin;

namespace GC2.Bussines.BMAdmin
{
    public class BMMovStock
    {
        public BMMovStock(string coneccion) 
        {
            this.Connection = coneccion;
        }

        private string connection = "";
        public string Connection
        {
            get { return connection; }
            set { connection = value; }
        }

        DAMovStock daMov = new DAMovStock();

        #region BMMovStockGetNext
        public MovStock BMMovStockGetNext(MovStock mov)
        {
            try
            {
                mov = daMov.DAMovStockGetNext(connection, mov);
                return mov;
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }           
        }
        #endregion

        #region BMMovStockInsert
        public void BMMovStockInsert(MovStock mov)
        {
            try
            {
                daMov.DAMovStockInsert(connection, mov);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion
    }
}
